package com.gao.api.gate.quick.core.registry;

import java.util.Collection;

/**
 * <p>
 *     注册表模型
 * </p>
 *
 * @author gaoshuangwen
 * @since 2022/01/12 10:49
 */
public interface Registry<Node> {

    boolean addNode(Node node);

    boolean addAll(Collection<Node> nodes);

    boolean remove(Node node);

    void clear();

    Collection<Node> getNodes();

    default void bindChangeHandler(RegistryChangeHandler handler){
     // noop
    }

    enum State {
        add,update,remove
    }

}
